<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="{{ url_for('static',filename='layui/css/layui.css') }}">
    <script type="text/javascript" src="{{ url_for('static',filename='jquery/jquery-3.5.1.min.js') }}"></script>
    <script type="text/javascript">
        //打印列表
        $(function() {
            $.ajax({
                url:"bookInfo",
                method:"get",
                success:function(result) {
                    {# json字符串改json对象 #}
                    jsonObj=JSON.parse(result);
                    var str="";
                    $.each(jsonObj,function(index,row) {
                        str+="<tr><td>"+row[0]+"</td><td>"+row[1]+"</td><td>"+row[2]+"</td><td>"+row[4]+"</td><td>"+row[3]+"</td>"+
                            "<td><a href='wish?bname="+row[0]+"' class='layui-btn layui-btn-radius layui-btn-warm'><span class='layui-icon layui-icon-form'></span>添加愿望单</a></td>" +
                            "<td><a href='shopping?bname="+row[0]+"' class='layui-btn layui-btn-radius layui-btn-warm'><span class='layui-icon layui-icon-cart'><span>添加购物车</a></td></tr>"
                        $("#tbody").html(str);
                    });
                },
                error:function (e) {
                    layer.msg("连接错误", {
                        time: 3000,
                        icon: 2
                    });
                }
            });
        });
    </script>
</head>
<body>
<div class="layui-elem-quote">
    书
</div>
<div>
    <table class="layui-table">
        <tr>
            <th>书名</th>
            <th>作者</th>
            <th>类别</th>
            <th>价钱</th>
            <th>剩余数量</th>
            <th>添加愿望单</th>
            <th>添加购物车</th>
        </tr>
        <tbody id="tbody">

        </tbody>
    </table>
</div>
<br>
<div class="layui-progress">
    <div class="layui-progress-bar" lay-percent="100%"></div>
</div>
<br>
<div class="layui-elem-quote">
    免费章节
</div>
<br>
<div class="layui-row">
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第一章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第二章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第三章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第四章</a>
    </div>
</div>
<br>
<hr class="layui-border-orange">
<br>
<div class="layui-row">
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第五章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第六章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第七章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第八章</a>
    </div>
</div>
<br>
<hr class="layui-border-orange">
<br>
<div class="layui-row">
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第九章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第十章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第十一章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第十二章</a>
    </div>
</div>
<br>
<hr class="layui-border-orange">
<br>
<div class="layui-row">
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第十三章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第十四章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第十五章</a>
    </div>
    <div class="layui-col-md3">
        <a href="" class="layui-font-20">第十六章</a>
    </div>
</div>
<br>
<div class="layui-progress">
    <div class="layui-progress-bar" lay-percent="100%"></div>
</div>
<br>
<div align="center">
    <h2>免费阅读结束！！！</h2>
</div>

<script src="{{ url_for('static',filename='layui/layui.js') }}"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
    });
</script>
</body>
</html>